page {
    padding: 0;
    /* 使用css变量定义安全边距 */
    --iphonex-fix-bottom: 0;
    --iphonex-fix-bottom: constant(
        safe-area-inset-bottom
    ); /* iOS11.2 beta 开始被弃用 */
    --iphonex-fix-bottom: env(safe-area-inset-bottom);
}

.horizon {
    border-bottom: 2px solid #bdbdbdc1;
    margin: 30rpx 0;
}

.top {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 24rpx;
    padding-bottom: 0;
    background: #f5f5f5;
    z-index: 5;
    .horizon {
        margin-bottom: 0;
    }
}

.panel {
    padding: 24rpx;
    padding-top: 150rpx;
    padding-bottom: calc(120rpx + var(--iphonex-fix-bottom) + 150rpx);
    display: flex;
    flex-direction: column;
}

.bottom {
    z-index: 5;
    position: fixed;
    bottom: calc(120rpx + var(--iphonex-fix-bottom));
    width: 100%;
    height: 150rpx;
    padding-bottom: 0;
    background: #f5f5f5;
    overflow: hidden;
    padding: 20rpx;
}

.inputArea {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 0 30rpx;
    border: 1px solid #dbe5ec;
    border-radius: 50rpx;

    @mixin icon() {
        border-radius: 50%;
        width: 60rpx;
        height: 60rpx;
    }

    .addIcon {
        @include icon();
        margin-right: 20rpx;
    }

    .button {
        @include icon();
        margin-left: 20rpx;
    }

    .input {
        flex: 1;
        border-right: 1px solid #e5e6e9;

        font-size: 32rpx;

        input {
            padding-right: 20rpx;
            height: 50rpx;
            line-height: 50rpx;
        }
    }
}

.message {
    width: fit-content;
    background: #dbe5ec;
    border-radius: 50rpx;
    padding: 20rpx 40rpx;
    font-size: 30rpx;
    margin: 20rpx 0;
    max-width: 80%;

    &Me {
        @extend .message;
        align-self: flex-end;
        background: #bccfe7;
    }

    &Rehab {
        @extend .message;
        position: relative;
        background: #fff;
        border: 1px solid #bccfe7;

        &::after {
            position: absolute;
            content: '';
            $size: 40rpx;
            width: $size;
            height: $size;
            background: url('~@/static/icons/circle-success.svg') center
                center/$size $size no-repeat;
            right: -10rpx;
            bottom: 0;
        }

        &Item {
            display: flex;
            &Left {
                margin-right: 30rpx;
            }
        }
    }

    &Time {
        color: #8a91a8;
        margin-bottom: 30rpx;

        &Me {
            @extend .messageTime;
            align-self: flex-end;
        }
    }
}
